LogCommand.WaitAsync (int) method
Waits a command to be finished asynchronously with a timeout.
Namespace: IntervalZero.KINGSTAR.Local.Class
Assembly: IntervalZero.KINGSTAR.Local.Class (in IntervalZero.KINGSTAR.Local.dll) Version: 4.4.0.0
Syntax
Task WaitAsync(
int millisecondsTimeout
bool abortOnTimeout
)
Function WaitAsync(
millisecondsTimeout As Integer
abortOnTimeout As Boolean
) As Task
Parameters
millisecondsTimeout
Type: int
The time period after which the command will be aborted if it is not finished. The unit of time is millisecond.
abortOnTimeout
Type: bool
true: the command will be aborted after the time in millisecondsTimeout has elapsed. false: the command won't be aborted. The program keeps running no matter this command is finished or not.
Return value
Type: Task
Represents an asynchronous operation.
Remarks
When you use WaitAsync to wait a command, if the command is done before the specified time period has elapsed, the next command will be run. For example, if you set subsystem.Start().WaitAsync(30000, true).Wait();
and ISubsystem.Start is done in 20 seconds, WaitAsync will be ended and the next command will be run. It won't wait 30 seconds.
See also